---
id: 660f280dda5040f707c76b4a
title: Step 40
challengeType: 1
dashedName: step-40
---

# --description--

Now you have a series of `#` characters, but the pyramid shape is still missing. Fortunately, the `i` variable represents the current "row" number in your loop, enabling you to use it for crafting a pyramid-like structure.

To achieve this, you will use the `.repeat()` method available to strings. This method accepts a number as an argument, specifying the number of times to repeat the target string. For example, using `.repeat()` to generate the string `"Code! Code! Code!"`:

```js
const activity = "Code! ";
activity.repeat(3);
```

Use the `.repeat()` method on your `character`, and give it `i` for the number.

# --hints--

You should use the `.repeat()` method.

```js
assert.match(code, /\.repeat\(/);
```

You should use the `.repeat()` method on your `character` variable.

```js
assert.match(code, /character\.repeat\(/);
```

You should pass `i` to your `.repeat()` method.

```js
assert.match(code, /character\.repeat\(\s*i\s*\)/)
```

# --seed--

## --seed-contents--

```js
const character = "#";
const count = 8;
const rows = [];

--fcc-editable-region--
for (let i = 0; i < count; i = i + 1) {
  rows.push(character);
}
--fcc-editable-region--

let result = ""

for (const row of rows) {
  result = result + "\n" + row;
}

console.log(result);
```
